from django.urls import re_path

from xj_users import views
from .views import HostCityView, EnterpriseViewSet, RecruitViewSet, EnterpriseDetailView, Job_ViewSet





urlpatterns = [
    # 热门城市列表 1
    re_path(r'^city/hotlist/$', HostCityView.as_view()),

    # 企业访问量增加统计1
    re_path(r'^enterprise/(?P<pk>\d+)/visit/$', EnterpriseViewSet.as_view({'put': 'qyvistcount'})),

    # 4个热门企业的返回 1
    re_path(r'^enterprise/search/hotlist/$', EnterpriseViewSet.as_view({'get': 'hotest_enterprise'})),

    # 用户收藏企业 1
    re_path(r'^enterprise/(?P<pk>\d+)/collect/$', EnterpriseViewSet.as_view({'post': 'user_shoucangQY'})),

    # 企业详情视图 1
    re_path(r'^enterprise/(?P<pk>\d+)/$', EnterpriseDetailView.as_view()),

    # 取消已收藏的企业
    re_path(r'^enterprise/(?P<pk>\d+)/cancelcollect/$', EnterpriseViewSet.as_view({'post': 'user_deleteQY'})),

    # =============================================================================================

    # 推荐职位 1
    re_path(r'^recruits/search/recommend/$', RecruitViewSet.as_view({'get': 'tj_job'})),

    # 最新职位 1
    re_path(r'^recruits/search/latest/$', RecruitViewSet.as_view({'get': 'newest_job'})),

    # 搜索职位 1
    re_path(r'^recruits/search/city/keyword/$', RecruitViewSet.as_view({'post': 'searchjob'})),

    # 职位访问次数 1
    re_path(r'^recruits/(?P<pk>\d+)/visit/$', RecruitViewSet.as_view({'put': 'job_vistcount'})),

    # 职位详情 1
    re_path(r'^recruits/(?P<pk>\d+)/$', Job_ViewSet.as_view()),

    # 收藏职位 1
    re_path(r'^recruits/(?P<pk>\d+)/collect/$', RecruitViewSet.as_view({'post': 'user_celectingJob'})),

    #　取消收藏了的职位
    re_path(r'^recruits/(?P<pk>\d+)/cancelcollect/$', RecruitViewSet.as_view({'post': 'usr_deleteJob'})),




]



